home *** CD-ROM | disk | FTP | other *** search
- #include <fcntl.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <sys/stat.h>
-
- main(int argc, char **argv)
- {
- int i,inf,outf;
- char *buf,name[99];
- struct stat statbuf;
- for (i = 0; i < argc; i++)
- {
- printf("Arg %d = \"%s\"\n", i, argv[i]);
- }
- fflush(stdout);
- strcpy(name, argv[argc-1]);
- if (stat(name, &statbuf)) perror(name),exit(-2);
- printf("File size = %d bytes\n", statbuf.st_size);
- exit(0);
- }
-